<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model common\models\Ad */

$this->title = $model->title;
$this->params['breadcrumbs'][] = ['label' => Yii::t('common', 'ad'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="ad-view">

    <p>
        <?= Html::a(Yii::t('common', 'update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
        <?= Html::a(Yii::t('common', 'delete'), ['delete', 'id' => $model->id], [
            'class' => 'btn btn-danger',
            'data' => [
                'confirm' => Yii::t('common', 'are_you_sure_you_want_to_delete_this_item?'),
                'method' => 'post',
            ],
        ]) ?>
    </p>

    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            //'id',
            'title',
            'position',
            [
                'attribute' => 'type',
                'value' => \common\helpers\TStringHelper::getAdType($model->type),
            ],
            'url:url',
            'content:ntext',
            'order',
            [
                'attribute' => 'type',
                'value' => \common\helpers\TStringHelper::getStatusText($model->status),
            ],
        ],
        'template' => '<tr><th width="100px">{label}</th><td>{value}</td></tr>',
    ]) ?>

</div>
